import requests
import kkl_config

class Order:
    def __init__(self):
        self.url = kkl_config.URL

    def importOrder(self,start_num,count,productIds):
        start_num = start_num
        count = count
        productIds = str(productIds)
        for i in range (start_num,start_num + count):
            memberPhone = str(i)
            json_data ={
    "service_name": "salesmng.OrderBackFacade.batchImportOrderList",
    "client_id": "6",
    "strategy": "dubbo",
    "timestamp": 1668676167038,
    "token": kkl_config.Token.token,
    "param": {
        "backOrderList": [
            {
                "memberPhone": memberPhone,
                "productIds": productIds,
                "classIds": kkl_config.Variable.variable,
                "provinceId": 330000,
                "cityId": 330100,
                "countyId": 330105,
                "contact": "张三",
                "mobileNo": "17000000102",
                "addressDetail": "开课啦",
                "odType": 2,
                "odBizType": 1,
                "lookPlatformId": 1,
                "importMemberDTO": {
                    "realName": "张三",
                    "grade": 7,
                    "schoolId": 132537,
                    "classes": 79,
                    "mathScore": 100,
                    "scienceScore": 100,
                    "schoolRank": 10
                },
                "areaId": 76061,
                "checkStock": True,
                "classType": "7",

            }
        ],
        "operator": "6PaxK0sx"
    }
}

            respone = requests.post(self.url,json=json_data)
            kkl_config.prints(respone)
            print(respone.json())

if __name__ == "__main__":
    from login01 import LoginApi
    LoginApi().loginMobile()
    LoginApi().xhxLogin()
    from kkl_class import Class
    Class().getClassid(105953,3367)
    Order().importOrder(17000000003,2,90003524)